import Vue from 'vue'
import Router from 'vue-router'

//import Home from '@/view/Home'
import TodoTaskList from '@/view/bpm/todoTaskList'

import ApproveList from '@/view/bpm/approveList'
import DefinitionList from '@/view/bpm/definitionList'
import ApplyList from '@/view/bpm/applyList'
import DraftList from '@/view/bpm/draftList'

import formCustSqlView from '@/view/custsql/formCustSqlView'

import ComplateTask from '@/view/bpm/taskComplate'
import InstanceDetail from '@/view/bpm/instanceDetail'
import Start from '@/view/bpm/start'
import Preview from '@/view/bpm/preview'

import Authorization from '@/view/auth/authorization'
import dingAuthorization from '@/view/auth/dingAuthorization'

import carboncopyReceiveList from '@/view/bpm/carboncopyReceiveList'

import Test from '@/view/test'

import setting from '@/setting'
Vue.use(Router)

export default new Router({
	mode: setting.routerMode,
	base: '/bpm-app/',
	routes: [{
		path: '/',
		name: 'Index',
		redirect: '/home',
		component: resolve => require(['@/view/index'], resolve),
		children: [
			{
				path: 'home',
				name: 'Home',
				component: resolve => require(['@/view/Home'], resolve)
			},
			{
				path: 'news',
				name: 'News',
				component: resolve => require(['@/view/news/newsList'], resolve)
			},
			{
				path: 'notice',
				name: 'Notice',
				component: resolve => require(['@/view/notice/noticeList'], resolve)
			},
		]
	},
	{
		path: '/login',
		name: 'Login',
		component: resolve => require(['@/view/login/login'], resolve)
	},
	{
		path: '/newsDetail',
		name: 'NewsDetail',
		component: resolve => require(['@/view/news/newsDetail'], resolve)
	},
	{
		path: '/noticeDetail',
		name: 'NoticeDetail',
		component: resolve => require(['@/view/notice/noticeDetail'], resolve)
	},
	{
		path: '/homeEdit',
		name: 'HomeEdit',
		component: resolve => require(['@/view/editInfo/homeEdit'], resolve)
	},
	{
		path: '/bpm/todoTaskList',
		name: '我的待办',
		component: TodoTaskList
	},
	{
		path: '/test',
		name: '测试组件页面',
		component: Test
	},
	{
		path: '/bpm/approveList',
		name: '办理历史',
		component: ApproveList
	},
	{
		path: '/bpm/definitionList',
		name: '发起申请',
		component: DefinitionList
	},
	{
		path: '/bpm/applyList',
		name: '申请历史',
		component: ApplyList
	},
	{
		path: '/bpm/draftList',
		name: '我的草稿',
		component: DraftList
	},
	{
		path: '/bpm/start',
		name: '流程启动',
		component: Start
	},
	{
		path: '/bpm/complateTask',
		name: '处理任务',
		component: ComplateTask
	},
	{
		path: '/bpm/instanceDetail',
		name: '流程详情',
		component: InstanceDetail
	},
	{
		path: '/bpm/preview',
		name: '表单预览',
		component: Preview
	},
	{
		path: '/authorization',
		name: '鉴权',
		component: Authorization
	},
	{
		path: '/abDing',
		name: '钉钉鉴权',
		component: dingAuthorization
	},
	
	{
		path: '/bpm/carboncopyReceiveList',
		name: '抄送',
		component: carboncopyReceiveList
	},
	{
		path: '/form/formCustSqlView',
		name: '自定义列表',
		component: formCustSqlView
	}
	]
})
